package fr.pud.client.images;

import java.awt.Image;
import java.io.IOException;
import java.net.URL;

import javax.imageio.ImageIO;
import javax.swing.ImageIcon;

import fr.pud.client.LaunchProgram;
import fr.pud.client.i18n.LanguagesConstants;
import fr.pud.utils.Tools;

public class ImagesDatabase {
    public static ImageIcon    ADDRESSES;
    public static ImageIcon    BRUSH;
    public static ImageIcon    BUBBLE;
    public static ImageIcon    CALCULATOR;
    public static ImageIcon    EDIT;
    public static ImageIcon    EXISTING_FILES;
    public static ImageIcon    FULL_TRASH;
    public static ImageIcon    GO_TO;
    public static ImageIcon    HIDE_ADDRESSES;
    public static ImageIcon    HIDE_QUERIES;
    public static ImageIcon    HIDE_ROUTES;
    public static ImageIcon    HIDE_TRUCK;
    public static final String IMAGE_POINTER_NAME_BLUE   = "images/addressPointerBleuClair1_133_255.png";
    public static final String IMAGE_POINTER_NAME_GREEN  = "images/addressPointerBleuVertClair168_255_1.png";
    public static final String IMAGE_POINTER_NAME_ORANGE = "images/addressPointerOrange255_161_1.png";
    public static final String IMAGE_POINTER_NAME_PURPLE = "images/addressPointerViolet216_0_255.png";
    public static final String IMAGE_POINTER_NAME_RED    = "images/addressPointerStart.png";
    public static ImageIcon    IMAGES_SUBBUBBLE;
    public static ImageIcon    IMAGES_SUBBUBBLE_LEFT;
    public static ImageIcon    IMAGES_SUBBUBBLE_RIGHT;
    public static ImageIcon    IMAGES_SUBBUBBLE_TOP_CENTER;
    public static ImageIcon    IMAGES_SUBBUBBLE_TOP_LEFT;
    public static ImageIcon    IMAGES_SUBBUBBLE_TOP_RIGHT;
    public static ImageIcon    LOAD;
    public static ImageIcon    OSM_ICON;
    public static URL          OSM_ICON_URL;
    public static ImageIcon    PLUS;
    public static Image        POINTER_BLUE;
    public static Image        POINTER_GREEN;
    public static Image        POINTER_ORANGE;
    public static Image        POINTER_PURPLE;
    public static Image        POINTER_RED;
    public static ImageIcon    QUERIES;
    public static ImageIcon    RED_CROSS;
    public static ImageIcon    ROAD;
    public static ImageIcon    ROUND;
    public static ImageIcon    SAVE;
    public static ImageIcon    TRUCK;
    public static ImageIcon    VALIDATE;

    public ImagesDatabase() {
        try {
            POINTER_RED = ImageIO.read(LaunchProgram.class
                    .getResource(IMAGE_POINTER_NAME_RED));
            POINTER_BLUE = ImageIO.read(LaunchProgram.class
                    .getResource(IMAGE_POINTER_NAME_BLUE));
            POINTER_ORANGE = ImageIO.read(LaunchProgram.class
                    .getResource(IMAGE_POINTER_NAME_ORANGE));
            POINTER_GREEN = ImageIO.read(LaunchProgram.class
                    .getResource(IMAGE_POINTER_NAME_GREEN));
            POINTER_PURPLE = ImageIO.read(LaunchProgram.class
                    .getResource(IMAGE_POINTER_NAME_PURPLE));
        }
        catch (IOException e) {
            Tools.writeToLogFile(
                    LanguagesConstants.LANGUAGE
                            .getString(LanguagesConstants.ERROR_FILE)
                            + ": images/addressPointerStart.png", true, e
                            .getStackTrace());
        }
        CALCULATOR = new ImageIcon(
                LaunchProgram.class.getResource("images/calculator.png"));
        EDIT = new ImageIcon(LaunchProgram.class.getResource("images/edit.png"));
        OSM_ICON_URL = LaunchProgram.class.getResource("images/osmIcon.png");
        OSM_ICON = new ImageIcon(
                LaunchProgram.class.getResource("images/osmIcon36x36.png"));
        RED_CROSS = new ImageIcon(
                LaunchProgram.class.getResource("images/redCross.png"));
        FULL_TRASH = new ImageIcon(
                LaunchProgram.class.getResource("images/fullTrash.png"));
        TRUCK = new ImageIcon(
                LaunchProgram.class.getResource("images/truck.png"));
        ROUND = new ImageIcon(
                LaunchProgram.class.getResource("images/round.png"));
        VALIDATE = new ImageIcon(
                LaunchProgram.class.getResource("images/validate.png"));
        GO_TO = new ImageIcon(
                LaunchProgram.class.getResource("images/goTo.png"));
        ADDRESSES = new ImageIcon(
                LaunchProgram.class.getResource("images/loadAddresses.png"));
        QUERIES = new ImageIcon(
                LaunchProgram.class.getResource("images/queries.png"));
        EXISTING_FILES = new ImageIcon(
                LaunchProgram.class.getResource("images/existingFile.png"));
        BRUSH = new ImageIcon(
                LaunchProgram.class.getResource("images/brush.png"));
        BUBBLE = new ImageIcon(
                LaunchProgram.class.getResource("images/bubble.png"));
        PLUS = new ImageIcon(LaunchProgram.class.getResource("images/plus.png"));
        ROAD = new ImageIcon(LaunchProgram.class.getResource("images/road.png"));
        SAVE = new ImageIcon(LaunchProgram.class.getResource("images/save.png"));
        LOAD = new ImageIcon(LaunchProgram.class.getResource("images/load.png"));
        HIDE_TRUCK = new ImageIcon(
                LaunchProgram.class.getResource("images/hideTruck.png"));
        HIDE_QUERIES = new ImageIcon(
                LaunchProgram.class.getResource("images/hideQueries.png"));
        HIDE_ROUTES = new ImageIcon(
                LaunchProgram.class.getResource("images/hideRoad.png"));
        HIDE_ADDRESSES = new ImageIcon(
                LaunchProgram.class.getResource("images/hideLoadAddresses.png"));
        IMAGES_SUBBUBBLE_LEFT = new ImageIcon(
                LaunchProgram.class.getResource("images/subBubbleLeft.png"));
        IMAGES_SUBBUBBLE_RIGHT = new ImageIcon(
                LaunchProgram.class.getResource("images/subBubbleRight.png"));
        IMAGES_SUBBUBBLE_TOP_LEFT = new ImageIcon(
                LaunchProgram.class.getResource("images/subBubbleTopLeft.png"));
        IMAGES_SUBBUBBLE_TOP_RIGHT = new ImageIcon(
                LaunchProgram.class.getResource("images/subBubbleTopRight.png"));
        IMAGES_SUBBUBBLE_TOP_CENTER = new ImageIcon(
                LaunchProgram.class
                        .getResource("images/subBubbleTopCenter.png"));
        IMAGES_SUBBUBBLE = new ImageIcon(
                LaunchProgram.class.getResource("images/subBubble.png"));
    }
}
